package meiyunting.shiwuzhaoling_gatway.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.HashMap;
import java.util.Map;

/**
 * 测试控制器
 * 用于测试网关服务是否正常工作
 */
@RestController
public class TestController {

    /**
     * 健康检查接口
     */
    @GetMapping("/actuator/health")
    public Mono<Map<String, Object>> health() {
        Map<String, Object> health = new HashMap<>();
        health.put("status", "UP");
        
        Map<String, String> details = new HashMap<>();
        details.put("gateway", "Gateway is healthy!");
        health.put("details", details);
        
        return Mono.just(health);
    }
    
    /**
     * 测试接口
     */
    @GetMapping("/test")
    public Mono<String> test() {
        return Mono.just("Gateway test successful!");
    }
} 